Manages the meshes available in the component.
More...
Manages the meshes available in the component.
The manager owns all memory allocated inside. External code should never delete it.
◆ ~MeshManager()
nkGraphics::MeshManager::~MeshManager |
( |
| ) |
|
◆ createOrRetrieve()
Mesh* nkGraphics::MeshManager::createOrRetrieve |
( |
const std::string_view & |
name | ) |
|
Creates if unavailable, or retrieves if available, a mesh.
- Parameters
-
name | The name of the mesh to retrieve. |
- Returns
- The mesh requested, possibly freshly created. The manager owns the memory returned, external code should never free it. See erase().
◆ get()
Mesh* nkGraphics::MeshManager::get |
( |
const std::string_view & |
name | ) |
const |
Retrieves an existing mesh.
- Parameters
-
name | The name of the mesh to retrieve. |
- Returns
- The mesh requested if available, nullptr else.
◆ getByIndex()
Mesh* nkGraphics::MeshManager::getByIndex |
( |
unsigned int |
index | ) |
const |
Retrieves a mesh by index. Note that an index can be attached to different meshes as the internal memory gets updated. Mainly used to go over all meshes in one go.
- Parameters
-
index | The index of the mesh to retrieve. |
- Returns
- The mesh requested if available, nullptr else.
◆ rename()
void nkGraphics::MeshManager::rename |
( |
const std::string_view & |
currentName, |
|
|
const std::string_view & |
newName |
|
) |
| |
Renames a mesh, changing both its name and the way to access it through the manager.
- Parameters
-
currentName | The name of the mesh to rename. |
newName | The new name to assign to it. |
◆ erase()
void nkGraphics::MeshManager::erase |
( |
const std::string_view & |
name | ) |
|
Erases and frees the memory of a mesh.
- Parameters
-
name | The name of the mesh to erase. |
The documentation for this class was generated from the following file: